/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.appstreet.domain.entities;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ramesh
 */
@Entity
@Table(name = "companydetails", catalog = "appstreet", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CompanyDetails.findAll", query = "SELECT c FROM CompanyDetails c"),
    @NamedQuery(name = "CompanyDetails.findById", query = "SELECT c FROM CompanyDetails c WHERE c.id = :id")})
public class CompanyDetails implements Serializable {
    
    @Id
    @GeneratedValue
    private Long id;
    @Lob
    @Column(length=1024)
    private byte[] details;
    @OneToOne(cascade= CascadeType.ALL )
    private Company company;
    
    public CompanyDetails() {
    }

    public byte[] getDetails() {
        return details;
    }

    public void setDetails(byte[] details) {
        this.details = details;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CompanyDetails other = (CompanyDetails) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }
    
    
    
}
